package org.duiduo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.duiduo.common.bean.OrderVO;
import org.duiduo.common.request.OrderFindPageRequest;
import org.duiduo.entity.Order;

import java.util.List;

public interface OrderMapper extends BaseMapper<Order> {

	@Update("update t_order set state = #{state},pay_time = #{payTime},count = #{order.count},total_price = #{order.totalPrice}, pay_price = #{order.payPrice} where order_no = #{order.orderNo}")
	int updateOrderSuccess(@Param("order") Order order, @Param("state") int state, @Param("payTime") String payTime);

	// 一对多查询
	List<OrderVO> findPage(OrderFindPageRequest request);

	// 条数
	int total(OrderFindPageRequest request);
}
